// 1.引入vue
import Vue from 'vue'
// 2.引入vuerouter
import VueRouter from 'vue-router'
import Login from '@/views/login.vue'
import Home from '@/views/home.vue'
import Users from '@/views/users/users.vue'
import Welcome from '@/views/welcome.vue'
// import RightList from '@/views/rights/rightList.vue'
// import RoleList from '@/views/rights/roleList.vue'
import RightList from '@/views/rights/rightList.vue'
import RoleList from '@/views/rights/roleList.vue'

// 3.让vue使用vuetouter
Vue.use(VueRouter)

// 创造路由对象,配置
export default new VueRouter({

  routes: [
    {
      name: 'default',
      path: '/',
      redirect: { name: 'Login' }

    },
    {
      name: 'Login',
      path: '/Login',
      component: Login
    },
    {
      name: 'Home',
      path: '/Home',
      component: Home,
      redirect: { name: 'Welcome' },
      children: [
        {
          name: 'users',
          path: 'Users',
          component: Users
        },
        {
          name: 'Welcome',
          path: 'Welcome',
          component: Welcome
        },
        {
          name: 'RightList',
          path: 'RightList',
          component: RightList
        },
        {
          name: 'RoleList',
          path: 'RoleList',
          component: RoleList
        }

      ]
    }

  ]

})
